package com.zksk.admin.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zksk.admin.api.domain.portal.vo.SanctionsRequestVo;
import com.zksk.admin.api.domain.portal.vo.ViolateRequestVo;
import com.zksk.admin.api.factory.RemotePublicityFallbackFactory;
import com.zksk.common.core.constant.SecurityConstants;
import com.zksk.common.core.constant.ServiceNameConstants;
import com.zksk.common.core.domain.R;
import com.zksk.mbg.admin.domain.Sanctions;
import com.zksk.mbg.admin.domain.Violate;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * admin门户相关模块
 *
 * @author zksk
 */
@FeignClient(contextId = "RemotePublicityService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemotePublicityFallbackFactory.class)
public interface RemotePublicityService {

    /**
     * 获取违规资讯分页列表
     * @param requestVo
     * @param source
     * @return
     */
    @PostMapping(value = "/portal/violate/list")
    R<Page<Violate>> violatePage(@RequestBody ViolateRequestVo requestVo,
                                 @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    /**
     * 根据violateId查询违规信息详情
     * @param violateId
     * @param source
     * @return
     */
    @PostMapping(value = "/portal/violate/{violateId}")
    R<Violate> selectViolate(@PathVariable("violateId") Long violateId,
                             @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 获取奖惩信息分页列表
     * @param requestVo
     * @param source
     * @return
     */
    @PostMapping(value = "/portal/sanctions/list")
    R<Page<Sanctions>> sanctionsPage(@RequestBody SanctionsRequestVo requestVo,
                                     @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    /**
     * 根据sanctionsId查询奖惩信息详情
     * @param sanctionsId
     * @param source
     * @return
     */
    @PostMapping(value = "/portal/sanctions/{sanctionsId}")
    R<Sanctions> selectSanctions(@PathVariable("sanctionsId") Long sanctionsId,
                                 @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
